home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 235_02 / ovview.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-06-16  |  23.1 KB  |  696 lines

  1. /*  028  11-Jan-87  ovview.c
  2.  
  3.         Copyright (c) 1987 by Blue Sky Software.  All rights reserved.
  4. */
  5.  
  6. #include <stdio.h>
  7. #include <fcntl.h>
  8. #include <sys/types.h>
  9. #include <sys/stat.h>
  10. #include "ov.h"
  11.  
  12. #define H_bar (0xcd)
  13. #define V_bar (179)
  14.  
  15. #define Vnextch(fh) ((curp < endp) ? *curp++ : vnextch(fh))  /* speed up */
  16. #define Vprevch(fh) ((curp > bufp) ? *--curp : vprevch(fh))  /* buffer access */
  17.  
  18. extern unsigned char far *curp;                /* current char position */
  19. extern unsigned char far *bufp, far *endp;     /* buffer begin/end pointers */
  20.  
  21. static int (*mark_func)();             /* pointer to marker function */
  22. static int nlines;                     /* # lines displayed on screen */
  23. static unsigned char ascmode;          /* true means ascii mode display */
  24. static unsigned char bitmask;          /* for 7 or 8 bit display mode */
  25. static int inf;                        /* handle for file being viewed */
  26. static int margin;                     /* margin for right/left scrolling */
  27. static long tos;                       /* top of screen offset in file */
  28. static long markers[5];                /* marker positions  */
  29.  
  30. /* function delcarations created by -Zg option - ALTCALL added
  31.    NOTE: anything called by menu routine cannot be ALTCALL */
  32.  
  33. /*global*/  int view(void);
  34. /*global*/  int view_move(int );
  35. static int view_exit(void), view_down(void), view_up(void), view_next(void);
  36. static int view_prev(void), view_tof(void), view_eof(void);
  37. static int view_right(void), view_left(void), view_set(void), view_goto(void);
  38. static int do_mark(void), setmark(void), gomark(void), ALTCALL view_line(void);
  39. static int ALTCALL fmt_asc_line(char *,int *), ALTCALL fmt_hex_line(char *,int *);
  40. static int view_7bit(void), view_8bit(void), view_asc(void), view_hex(void);
  41. static int ALTCALL align(void);
  42. static int ALTCALL backup(int );
  43. static int ALTCALL peol(void);
  44. static int ALTCALL nsol(void);
  45. static int ALTCALL more2view(void);
  46.  
  47. static struct key_ent {        /* table mapping movement keys to function */
  48.    int key;
  49.    int (*func)();
  50. } key2func[] = { { DOWN, view_next }, { UP, view_prev }, { PGDN, view_down },
  51.    { PGUP, view_up }, { HOME, view_tof }, { END, view_eof },
  52.    { RIGHT, view_right }, { LEFT, view_left } };
  53.  
  54. #define NMOVKEYS (8)
  55.  
  56. extern MENU_STATE curmenu;
  57. extern MENU top_file_menu[], *top_menu;
  58.  
  59. static char setgo[] = "Set/Goto marker";
  60.  
  61. static MENU mark_menu[] = {
  62.    { "1", setgo, do_mark, NULL },
  63.    { "2", setgo, do_mark, NULL },
  64.    { "3", setgo, do_mark, NULL },
  65.    { "4", setgo, do_mark, NULL },
  66.    { "5", setgo, do_mark, NULL },
  67.    { NULL, NULL, NULL, NULL }
  68. };
  69.  
  70.  
  71. MENU top_view_menu[] = {
  72.    { "Dwn", "Page down in the file", view_down, NULL },
  73.    { "Up", "Page up in the file", view_up, NULL },
  74.    { "Nxt", "Advance one line", view_next, NULL },
  75.    { "Prv", "Backup one line", view_prev, NULL },
  76.    { "TOF", "Goto Top Of File", view_tof, NULL },
  77.    { "EOF", "Goto End Of File", view_eof, NULL },
  78.    { "Rght", "Scroll right 8 characters", view_right, NULL },
  79.    { "Left", "Scroll left 8 characters", view_left, NULL },
  80.    { "Set", "Set marker at current position", view_set, mark_menu },
  81.    { "Goto", "Goto set marker position", view_goto, mark_menu },
  82.    { "Ascii", "View file as ASCII characters", view_asc, NULL },
  83.    { "Hex", "View file in hexadecimal", view_hex, NULL },
  84.    { "7bit", "View low 7 bits of each character", view_7bit, NULL },
  85.    { "8bit", "View all 8 bits of each character", view_8bit, NULL },
  86.    { "Quit", "Return to file display", view_exit, top_file_menu },
  87.    { NULL, NULL, NULL, NULL }
  88. };
  89.  
  90. extern WINDOW cw;
  91. extern char *cantopen;
  92. extern FILE_ENT files[];
  93. extern unsigned char view_display, restricted;
  94.  
  95. int ALTCALL vbuf_init(int );           /* declarations for buffer routines */
  96. int ALTCALL vbuf_free(void);
  97. unsigned long ALTCALL vtell(void);
  98. int ALTCALL vseek(int ,long ), ALTCALL vnextch(int ), ALTCALL vprevch(int );
  99.  
  100. #define view_seek(off) vseek(inf,off)
  101.  
  102.  
  103. /******************************************************************************
  104.  **                             V I E W                                      **
  105.  *****************************************************************************/
  106.  
  107. view() {               /* view the current file at the terminal */
  108.  
  109.    int i;
  110.    register char *fn;
  111.    register FILE_ENT *fp;
  112.  
  113.    /* don't try to view file if its empty */
  114.  
  115.    fp = &files[cw.curidx];             /* a couple of quick pointers */
  116.  
  117.    if (fp->size == 0)
  118.       show_error(0,8,1,"This file is empty!");
  119.  
  120.    bitmask = 0xff;             /* defaults: 8 bit, ascii, left edge */
  121.    ascmode = TRUE;
  122.    margin = 0;
  123.  
  124.    /* open the file to be viewed, error out if can't open */
  125.  
  126.    if ((inf = open((fn = fname(fp)),O_RDONLY|O_BINARY)) == -1) {
  127.       free(fn);
  128.       show_error(1,8,3,cantopen,fp->name,": ");
  129.    }
  130.  
  131.    savescreen();               /* save current display image */
  132.    restricted = TRUE;          /* disable special file commands */
  133.    view_display = TRUE;        /* yes, we are viewing */
  134.  
  135.    for (i = 0; i < 5; i++)     /* set markers to TOF */
  136.       markers[i] = 0L;
  137.  
  138.    vbuf_init(inf);             /* initialize view buffer system */
  139.  
  140.    center_text(FIRST_VROW-1,fn); /* show file name */
  141.    free(fn);
  142.  
  143.    view_down();                /* display the first screen of file data */
  144.  
  145.    top_menu = top_view_menu;   /* setup the view menu as the main menu */
  146. }
  147.  
  148.  
  149. /******************************************************************************
  150.  **                        V I E W _ E X I T                                 **
  151.  *****************************************************************************/
  152.  
  153. static int
  154. view_exit() {          /* exit the view display, return to file display */
  155.  
  156.    close(inf);                 /* close file */
  157.    vbuf_free();                /* release memory */
  158.    top_menu = top_file_menu;   /* restore file menu as main */
  159.  
  160.    restricted = FALSE;         /* all commands are enabled */
  161.    view_display = FALSE;       /* not viewing */
  162.  
  163.    restorescreen();            /* redisplay prior screen image */
  164. }
  165.  
  166.  
  167. /******************************************************************************
  168.  **                        V I E W _ D O W N                                 **
  169.  *****************************************************************************/
  170.  
  171. static int
  172. view_down() {          /* page down into the view buffer/file */
  173.  
  174.    register int i;
  175.  
  176.    if (!more2view())           /* nothing to do if no more data to view */
  177.       return;
  178.  
  179.    nlines = 0;                 /* no lines displayed yet */
  180.    tos = vtell();              /* remember where top of screen is */
  181.  
  182.    /* display up to a screen full of file data, clear the screen as we go */
  183.  
  184.    for (i = 0; i < VIEW_ROWS; i++) {
  185.       gotorc(i+FIRST_VROW,0);          /* position to line */
  186.       if (view_line())                 /* display a single line */
  187.          nlines++;                     /* count lines displayed */
  188.    }
  189. }
  190.  
  191.  
  192. /******************************************************************************
  193.  **                        V I E W _ U P                                     **
  194.  *****************************************************************************/
  195.  
  196. static int
  197. view_up() {            /* page up into the view buffer */
  198.  
  199.    long curoff;
  200.  
  201.    /* back two screen's worth, or to the top line in memory and use
  202.       view_down() to display the screen - only display if we really
  203.       backed up (might be at TOF) */
  204.  
  205.    curoff = vtell();                   /* where we were */
  206.    view_seek(tos);                     /* quickly to top of screen */
  207.    if (backup(VIEW_ROWS))              /* try to backup another screen */
  208.       view_down();                     /* display prior screen if backed up */
  209.    else
  210.       view_seek(curoff);               /* must be tof, back to where we were */
  211. }
  212.  
  213.  
  214. /******************************************************************************
  215.  **                        V I E W _ N E X T                                 **
  216.  *****************************************************************************/
  217.  
  218. static int
  219. view_next() {          /* display the next line in the buffer/file */
  220.  
  221.    long curoff;
  222.  
  223.    if (!more2view())           /* nothing to do if no more data to view */
  224.       return;
  225.  
  226.    /* set the new top of screen location */
  227.  
  228.    if (ascmode) {                      /* ascii mode display? */
  229.       curoff = vtell();                /* save where we are */
  230.       view_seek(tos);                  /* to top of screen  */
  231.       nsol();                          /* to start of next line */
  232.       tos = vtell();                   /* its the new top of screen */
  233.       view_seek(curoff);               /* back to bottom of screen */
  234.  
  235.    } else                              /* hex mode */
  236.      tos += 16;                        /* tos is just the next hex line */
  237.  
  238.    /* scroll the screen up one line to make room for the new line at bottom */
  239.  
  240.    delete_line(FIRST_VROW,VIEW_ROWS-1);
  241.  
  242.    gotorc(FIRST_VROW+VIEW_ROWS-1,0);   /* cursor to the last display line */
  243.  
  244.    view_line();                        /* display the line */
  245. }
  246.  
  247.  
  248. /******************************************************************************
  249.  **                        V I E W _ P R E V                                 **
  250.  *****************************************************************************/
  251.  
  252. static int
  253. view_prev() {          /* display the previous line in the buffer */
  254.  
  255.    long curoff;
  256.  
  257.    curoff = vtell();                   /* where we are now */
  258.    view_seek(tos);                     /* old top of screen */
  259.    if (backup(1)) {                    /* can we backup another line */
  260.       tos = vtell();                           /* if so, its new tos */
  261.       insert_line(FIRST_VROW+1,VIEW_ROWS-1);   /* insert a blank line */
  262.       gotorc(FIRST_VROW,0);                    /* cursor to first line */
  263.       view_line();                             /* display the line */
  264.       view_seek(curoff);                       /* back to old bottom */
  265.       if (nlines < VIEW_ROWS)                  /* is a full screen displayed? */
  266.          nlines++;                             /* no, one more displyed now */
  267.       else
  268.          backup(1);                            /* yes, back one line */
  269.  
  270.    } else                      /* couldn't backup, must be tof */
  271.       view_seek(curoff);
  272. }
  273.  
  274.  
  275. /******************************************************************************
  276.  **                        V I E W _ T O F                                   **
  277.  *****************************************************************************/
  278.  
  279. static int
  280. view_tof() {           /* backup and display the top of the file */
  281.  
  282.    view_seek(0L);              /* just go to top of file */
  283.    view_down();                /* and display a screen */
  284. }
  285.  
  286.  
  287. /******************************************************************************
  288.  **                        V I E W _ E O F                                   **
  289.  *****************************************************************************/
  290.  
  291. static int
  292. view_eof() {           /* display the end of the file */
  293.  
  294.    view_seek(files[cw.curidx].size);       /* seek to eof */
  295.    backup(VIEW_ROWS);                      /* backup a screen full */
  296.    view_down();                            /* display a screen full */
  297. }
  298.  
  299.  
  300. /******************************************************************************
  301.  **                        V I E W _ M O V E                                 **
  302.  *****************************************************************************/
  303.  
  304. view_move(mov_cmd)     /* move around the view buffer/file in response to */
  305. int mov_cmd;           /* single key commands when viewing a file */
  306. {
  307.  
  308.    register int i;
  309.  
  310.    /* basically, we just map the special keys to the same functions
  311.       performed by the menu options */
  312.  
  313.    for (i = 0; i < NMOVKEYS; i++)
  314.       if (mov_cmd == key2func[i].key) {
  315.          (*key2func[i].func)();
  316.          break;
  317.       }
  318. }
  319.  
  320.  
  321. /*****************************************************************************
  322.                  V I E W _ S E T / G O T O / M A R K
  323.  *****************************************************************************/
  324.  
  325. static int
  326. view_set() {           /* prepare to set a marker to current position */
  327.  
  328.    mark_func = setmark;        /* use the setmark routine later */
  329. }
  330.  
  331. static int
  332. view_goto() {          /* prepare to goto a marker position */
  333.  
  334.    mark_func = gomark;         /* use the gomark routine later */
  335. }
  336.  
  337. static int
  338. do_mark() {            /* set or goto a marker position */
  339.  
  340.    (*mark_func)();
  341. }
  342.  
  343. static int
  344. setmark() {            /* set a marker position */
  345.  
  346.    markers[curmenu.current_selection] = tos;
  347. }
  348.  
  349. static int
  350. gomark() {             /* goto a marker position */
  351.  
  352.    tos = markers[curmenu.current_selection];   /* where tos should be */
  353.    align();                                    /* start at begining of line */
  354.    view_down();                                /* display screen full */
  355. }
  356.  
  357.  
  358. /*****************************************************************************
  359.                            V I E W _ L I N E
  360.  *****************************************************************************/
  361.  
  362. static int ALTCALL
  363. view_line() {          /* display a single line of the file */
  364.  
  365.    int col, ch;
  366.    char line[SCREEN_COLS+1];
  367.  
  368.    if (ascmode)                /* format the line as ascii or hex data */
  369.       ch = fmt_asc_line(line,&col);
  370.    else
  371.       ch = fmt_hex_line(line,&col);
  372.  
  373.    disp_str(line);                     /* make one call to display line */
  374.  
  375.    if (col < margin+SCREEN_COLS-1)     /* clear if < full line displayed */
  376.       clr_eol();
  377.  
  378.    return(ch != EOF || col);   /* return true if something displayed */
  379. }
  380.  
  381.  
  382. /*****************************************************************************
  383.                          F M T _ A S C _ L I N E
  384.  ****************************************************************************/
  385.  
  386. static int ALTCALL
  387. fmt_asc_line(op,colp)  /* format an ascii line for display */
  388. char *op;
  389. int *colp;
  390. {
  391.    register int ch, col = 0;
  392.    int i, endcol = margin + SCREEN_COLS;
  393.  
  394.    while ((ch = Vnextch(inf)) != EOF && (ch = ch & bitmask) != '\n')
  395.       if (ch == '\t') {
  396.          for (i = 8 - (col & 7); i; i--, col++)
  397.             if (col >= margin && col < endcol)
  398.                *op++ = ' ';
  399.        } else
  400.           if (ch != '\r' && ch != '\0') {
  401.               if (col >= margin && col < endcol)
  402.                   *op++ = ch;
  403.              col++;
  404.           }
  405.  
  406.    *op = '\0';                 /* null terminate it for disp_str */
  407.  
  408.    *colp = col;                /* tell caller the # cloumns */
  409.    return(ch);                 /* and if EOF was reached */
  410. }
  411.  
  412.  
  413. /******************************************************************************
  414.                           F M T _ H E X _L I N E
  415.  *****************************************************************************/
  416.  
  417. static int ALTCALL
  418. fmt_hex_line(op,colp)  /* format a hex line for later display */
  419. register char *op;
  420. int *colp;
  421. {
  422.    int ch, ach, j;
  423.    register int i;
  424.    char offstr[9], *ap;
  425.    static char bin2hex[] = "0123456789ABCDEF";
  426.  
  427.    /* test if there is anything to format */
  428.  
  429.    if (vnextch(inf) == EOF) {
  430.       *colp = 0;
  431.       *op = '\0';
  432.       return(EOF);
  433.    } else
  434.       vprevch(inf);
  435.  
  436.    /* format data offset into buffer */
  437.  
  438.    ultoa(vtell(),offstr,16);           /* offset to hex */
  439.    j = strlen(offstr);
  440.    for (i = 6 - j; i > 0; i--)         /* zero fill */
  441.       *op++ = '0';
  442.    if (j <= 6)                         /* don't use more than 6 digits */
  443.      strcpy(op,offstr);
  444.    else
  445.      strcpy(op,offstr+j-6);
  446.  
  447.    strupr(op);                         /* ultoa leaves A-F in lower case */
  448.  
  449.    strcat(op,"  ");                    /* go beyond the offset */
  450.    op += strlen(op);
  451.  
  452.    ap = op + 53;                       /* where ascii data starts */
  453.    *ap++ = V_bar;                      /* might as well do it now */
  454.  
  455.    /* setup data in hex (and ascii) */
  456.  
  457.    for (i = 16; i; i--) {              /* at most 16 bytes to fmt */
  458.  
  459.       ch = Vnextch(inf);               /* next char from file */
  460.       if (ch == EOF)                   /* done? */
  461.          break;
  462.  
  463.       *op++ = bin2hex[(ch >> 4) & 0x0f];       /* hexalate it */
  464.       *op++ = bin2hex[ch & 0x0f];
  465.       *op++ = ' ';
  466.  
  467.       if (((i+3) & 3) == 0)            /* extra spacer every 4 bytes */
  468.          *op++ = ' ';
  469.  
  470.       if ((ach = ch & bitmask) < ' ')  /* do the ascii char, '.' if ctrl ch */
  471.          *ap++ = '.';
  472.       else
  473.          *ap++ = ach;
  474.    }
  475.  
  476.    /* blank fill if EOF was reached */
  477.  
  478.    for ( ; i; i--) {           /* i is # chars to blank fill */
  479.       strncpy(op,"   ",3);
  480.       op += 3;
  481.       if (((i+3) & 3) == 0)
  482.          *op++ = ' ';
  483.       *ap++ = ' ';
  484.    }
  485.  
  486.    *op++ = ' ';                /* up to ascii data */
  487.  
  488.    *ap++ = V_bar;              /* closing bar at end */
  489.    *ap = '\0';                 /* The Terminator */
  490.  
  491.    *colp = 74;                 /* tell call how many columns */
  492.    return(ch);                 /* and if EOF was reached */
  493. }
  494.  
  495.  
  496. /*****************************************************************************
  497.                       V I E W _ R I G H T / L E F T
  498.  *****************************************************************************/
  499.  
  500. static int
  501. view_right() {         /* scroll right 8 characters */
  502.  
  503.    margin += 8;
  504.    view_current();
  505.    disp_margin();
  506. }
  507.  
  508. static int
  509. view_left() {          /* scroll left 8 characters */
  510.  
  511.    if (margin >= 8) {
  512.       margin -= 8;
  513.       view_current();
  514.       disp_margin();
  515.    }
  516. }
  517.  
  518. static int
  519. disp_margin() {        /* display the viewing margins */
  520.  
  521.    char marstr[11];
  522.  
  523.    if (margin) {
  524.  
  525.       itoa(margin,marstr,10);
  526.       disp_msg(2,"COL: ",marstr);
  527.  
  528.    } else              /* must have just gone to 0 */
  529.  
  530.       clr_msg();
  531. }
  532.  
  533.  
  534. /*****************************************************************************
  535.                             V I E W _ n B I T
  536.  *****************************************************************************/
  537.  
  538. static int
  539. view_7bit() {          /* display data using low order 7 bits */
  540.  
  541.    if (bitmask != 0x7f) {
  542.       bitmask = 0x7f;
  543.       view_current();
  544.    }
  545. }
  546.  
  547. static int
  548. view_8bit() {          /* display data using all 8 bits per char */
  549.  
  550.    if (bitmask != 0xff) {
  551.       bitmask = 0xff;
  552.       view_current();
  553.    }
  554. }
  555.  
  556. static int
  557. view_current() {       /* redisplay the current screen */
  558.  
  559.       view_seek(tos);
  560.       view_down();
  561. }
  562.  
  563.  
  564. /*****************************************************************************
  565.                            V I E W _ A S C
  566.  *****************************************************************************/
  567.  
  568. static int
  569. view_asc() {           /* set ascii mode display */
  570.  
  571.    if (!ascmode) {                    /* only need to change if in hex mode */
  572.       ascmode = TRUE;                 /* set ascii mode */
  573.       align();                        /* make sure were at begining of line */
  574.       view_down();                       /* redisplay in ascii format */
  575.    }
  576. }
  577.  
  578.  
  579. /*****************************************************************************
  580.                           V I E W _ H E X
  581.  *****************************************************************************/
  582.  
  583. static int
  584. view_hex() {           /* set hex mode display */
  585.  
  586.    if (ascmode) {                     /* only need to change if in ascii mode */
  587.       ascmode = FALSE;                /* set hex mode */
  588.       align();                        /* make sure were at begining of line */
  589.       view_down();                    /* redisplay in ascii format */
  590.    }
  591. }
  592.  
  593.  
  594. /*****************************************************************************
  595.                                 A L I G N
  596.  *****************************************************************************/
  597.  
  598. static int ALTCALL
  599. align() {              /* align tos to be at the start of a line */
  600.  
  601.    if (ascmode) {              /* ascii mode? */
  602.  
  603.       view_seek(tos);                 /* backup to current top of screen */
  604.       if (backup(1))                  /* make sure were at the start of */
  605.          nsol();                      /*   the current line */
  606.  
  607.    } else {                    /* hex mode */
  608.  
  609.       tos &= ~((long) 0x0f);          /* force a paragraph boundry */
  610.       view_seek(tos);                 /* backup to current top of screen */
  611.    }
  612. }
  613.  
  614. /*****************************************************************************
  615.                                 B A C K U P
  616.  *****************************************************************************/
  617.  
  618. static int ALTCALL
  619. backup(todo)           /* backup todo lines from current position */
  620. int todo;
  621. {
  622.    register int i;
  623.    int part, bytes;
  624.    unsigned long off, lines;
  625.  
  626.     /* backup in hex mode */
  627.  
  628.     if (!ascmode) {                    /* different if in hex mode */
  629.        off = vtell();                  /* current loc in file */
  630.        lines = off >> 4;               /* # full hex display lines above */
  631.        part = (bytes = off & (long) 0x0f) > 0; /* may be partial line if at eof */
  632.        if (todo > lines + part) {              /* more todo than are? */
  633.           view_seek(0L);                       /* just goto tof */
  634.           return(lines + part);                /* went back this # lines */
  635.        } else {
  636.           view_seek(off - (((todo - part) << 4)+bytes)); /* backup todo lines */
  637.           return(todo);
  638.        }
  639.     }
  640.  
  641.     /* backup in ascii mode */
  642.  
  643.     /* special case backing up from EOF - there may or may not be a \n
  644.        at the end of the last line */
  645.  
  646.     if (vnextch(inf) == EOF) {         /* at end of file? */
  647.        vprevch(inf);                   /*   always backup at least one char */
  648.        i = 1;                          /*   we will backup 1 line here      */
  649.        if (peol() == '\n')             /*   goto start of prev line         */
  650.           vnextch(inf);
  651.     } else {           /* not at EOF, setup for loop down below */
  652.        i = 0;
  653.        vprevch(inf);
  654.     }
  655.  
  656.     /* backup todo ascii lines, 1 line may have been done above */
  657.  
  658.     for ( ; i < todo; i++) {
  659.       if (peol() == EOF)               /* goto end of prev line */
  660.          break;
  661.       if (peol() == '\n')              /* end of prev prev line */
  662.          vnextch(inf);                 /* start of prev line    */
  663.    }
  664.  
  665.    return(i);          /* tell caller how many ascii lines backed up */
  666. }
  667.  
  668. static int ALTCALL
  669. peol() {       /* move to end of prev line */
  670.  
  671.    register int ch;
  672.  
  673.    while ((ch = Vprevch(inf)) != '\n' && ch != EOF) ;  /* end of prev line */
  674.    return(ch);
  675. }
  676.  
  677. static int ALTCALL
  678. nsol() {       /* move to start of next line */
  679.  
  680.    register int ch;
  681.  
  682.    while ((ch = Vnextch(inf)) != '\n' && ch != EOF) ;  /* start of next line */
  683.    return(ch);
  684. }
  685.  
  686.  
  687. /*****************************************************************************
  688.                             M O R E 2 V I E W
  689.  *****************************************************************************/
  690.  
  691. static int ALTCALL
  692. more2view() {          /* return true if more data to view */
  693.  
  694.    return(vtell() < files[cw.curidx].size);
  695. }
  696.